1 商品管理
商品管理就是对电商项目中所涉及到的商品数据进行维护。
1.1 菜单添加
首先在系统中添加商品管理的菜单,具体步骤如下所示:
1、在后台管理系统中通过系统管理的菜单管理添加商品管理的相关菜单,如下所示:

2、给系统管理员角色分配商品商品管理菜单访问权限:

3、在前端项目中创建对应的页面,以及配置对应的异步路由
- 在src/views/product的文件夹中加入商品管理页面文件product.vue,如下所示:

- 在src/router/modules文件夹下创建product.js路由文件,文件内容如下所示:
const Layout = () => import('@/layout/index.vue')
const category = () => import('@/views/product/category.vue')
const brand = () => import('@/views/product/brand.vue')
const categoryBrand = () => import('@/views/product/categoryBrand.vue')
const productSpec = () => import('@/views/product/productSpec.vue')
const product = () => import('@/views/product/product.vue')
export default [
{
path: '/product',
component: Layout,
name: 'product',
meta: {
title: '商品管理',
},
icon: 'Histogram',
children: [
{
path: '/category',
name: 'category',
component: category,
meta: {
title: '分类管理',
},
},
{
path: '/brand',
name: 'brand',
component: brand,
meta: {
title: '品牌管理',
},
},
{
path: '/categoryBrand',
name: 'categoryBrand',
component: categoryBrand,
meta: {
title: '分类品牌',
},
},
{
path: '/productSpec',
name: 'productSpec',
component: productSpec,
meta: {
title: '商品规格',
},
},
{
path: '/product',
name: 'product',
component: product,
meta: {
title: '商品管理',
},
},
],
},
]